'use strict';

const Controller = require('egg').Controller;

class baseController extends Controller {
  async index() {
    const { controller, service } = this.ctx;
    return 'baseController';
  }

  async success({ code = 0, data = 0, message = '' }) {
    this.ctx.body = { code, data, message };
  }

  async error({ code = -1, data = 0, message = '' }) {
    this.ctx.body = { code, data, message };
  }



}

module.exports = baseController;
